package com.dajiba.demo;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;

import androidx.annotation.Nullable;

import com.blankj.utilcode.util.CloneUtils;
import com.blankj.utilcode.util.LogUtils;

public class CustomDrawArc extends BaseCustomView {

    public CustomDrawArc(Context context) {
        super(context);
    }

    public CustomDrawArc(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public CustomDrawArc(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);

        LogUtils.d("onDraw");

        Paint paint1 = new Paint();
        paint1.setColor(Color.BLUE);
        paint1.setAntiAlias(true);
        RectF rectF = new RectF(100, 600, 500, 800);
        canvas.drawArc(rectF,0,180,false,paint1);

        Paint paint2 = new Paint();
        paint2.setColor(Color.BLACK);
        paint2.setAntiAlias(true);
        canvas.drawArc(rectF,-90,70,true,paint2);

        mPaint.setStyle(Paint.Style.STROKE);
        canvas.drawArc(rectF,190,70,false,mPaint);
    }
}
